﻿using PizzaMario.Domain.Abstract;

namespace PizzaMario.Domain.Concrete
{
    public class DatabaseFactory : Disposable, IDatabaseFactory
    {
        private readonly Context _context;

        public DatabaseFactory(Context context)
        {
            _context = context;
        }

        #region IDatabaseFactory Members

        public Context Get()
        {
            return _context;
        }

        #endregion

        protected override void DisposeCore()
        {
            if (_context != null)
                _context.Dispose();
        }
    }
}
